package com.service.impl.user;

import com.dao.UserDao;
import com.service.user.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-10-23
 * Time: 下午3:01
 * To change this template use File | Settings | File Templates.
 */
@Transactional
@Service("customerService")
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private UserDao userDao;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return  userDao.findCustomerByUsername(username);
    }
}
